_init() {
super._init({ style_class: 'dash-item-container',
pivot_point: new Clutter.Point({ x: .5, y: .5 }),
+ scale_x: 0,
+ scale_y: 0,
+ opacity: 0,
x_expand: true,
x_align: Clutter.ActorAlign.CENTER });
this.label_actor = this.label;
this.child = null;
- this._childScale = 0;
- this._childOpacity = 0;
this.animatingOut = false;
+ this.connect('notify::scale-x', () => this.queue_relayout());
+ this.connect('notify::scale-y', () => this.queue_relayout());
+
this.connect('destroy', () => {
if (this.child != null)
this.child.destroy();
this.child = actor;
this.add_actor(this.child);
-
- this.set_scale(this._childScale, this._childScale);
- this.set_opacity(this._childOpacity);
}
show(animate) {
let time = animate ? DASH_ANIMATION_TIME : 0;
Tweener.addTween(this,
- { childScale: 1.0,
- childOpacity: 255,
+ { scale_x: 1.0,
+ scale_y: 1.0,
+ opacity: 255,
time: time / 1000,
transition: 'easeOutQuad'
});
this.animatingOut = true;
Tweener.addTween(this,
- { childScale: 0.0,
- childOpacity: 0,
+ { scale_x: 0,
+ scale_y: 0,
+ opacity: 0,
time: DASH_ANIMATION_TIME / 1000,
transition: 'easeOutQuad',
- onComplete: () => {
- this.destroy();
- }
+ onComplete: () => this.destroy()
});
}
-
- set childScale(scale) {
- this._childScale = scale;
-
- this.set_scale(scale, scale);
- this.queue_relayout();
- }
-
- get childScale() {
- return this._childScale;
- }
-
- set childOpacity(opacity) {
- this._childOpacity = opacity;
-
- this.set_opacity(opacity);
- this.queue_redraw();
- }
-
- get childOpacity() {
- return this._childOpacity;
- }
});
var ShowAppsIcon = GObject.registerClass(
this._container.set_offscreen_redirect(Clutter.OffscreenRedirect.ALWAYS);
this._showAppsIcon = new ShowAppsIcon();
- this._showAppsIcon.childScale = 1;
- this._showAppsIcon.childOpacity = 255;
+ this._showAppsIcon.show(false);
this._showAppsIcon.icon.setIconSize(this.iconSize);
this._hookUpLabel(this._showAppsIcon);